package com.member.shop.domain;

import java.time.LocalDateTime;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.member.common.annotation.Excel;
import lombok.Data;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.experimental.SuperBuilder;
import com.member.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 消息对象 sys_biz_message
 *
 * @author lixinchen
 * @date 2025-01-08
 */
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_biz_message")
public class SysBizMessage extends BaseEntity {

    private static final long serialVersionUID = 1L;


    /**
     * 消息id
     */
    @TableId(type = IdType.AUTO)
    private Long id;


    /**
     * 租户id
     */
    @Excel(name = "租户id")
    private Long tenantId;


    /**
     * 标题
     */
    @Excel(name = "标题")
    private String title;


    /**
     * 摘要
     */
    @Excel(name = "摘要")
    private String summary;


    /**
     * 内容
     */
    @Excel(name = "内容")
    private String content;


    /**
     * 用户id
     */
    @Excel(name = "用户id")
    private Long userId;


    /**
     * 消息类型（1 系统消息 2 订单消息 3 客服消息 4 促销消息）
     */
    @Excel(name = "消息类型", readConverterExp = "1,系统消息,2,订单消息,3,客服消息,4,促销消息")
    private Integer messageType;


    /**
     * 业务主键（订单号 或者促销链接）
     */
    @Excel(name = "业务主键", readConverterExp = "订单号,或者促销链接")
    private String bussKey;


    /**
     * 消息时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "消息时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime messageTime;


    /**
     * 消息状态（0 未读 1 已读 ）
     */
    @Excel(name = "消息状态", readConverterExp = "0,未读,1,已读")
    private Integer messageStatus;


    /**
     * 阅读时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "阅读时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime readTime;


    /**
     * 是否删除(0：未删除，1：删除)
     */
    @Excel(name = "是否删除(0：未删除，1：删除)")
    private Integer deleted;

    @TableField(exist = false)
    private SysBizUser user;

}
